﻿<UserControl x:Class="Prototypes.AllAudiences"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="550" d:DesignWidth="900">
    <UserControl.Resources>
        <DataTemplate x:Key="DenuncianteItemTemplate">
            <Border BorderThickness="0,0,0,0" BorderBrush="#6FBDE8">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="80" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <Image Source="Images/NoImage.jpg" Width="80" Height="80" Grid.Column="0" HorizontalAlignment="Center" />
                    <TextBlock Margin="10,0,0,0" Text="{Binding Denunciante}" VerticalAlignment="Center" Grid.Column="1" ToolTip="Nombre denunciante" />
                    <TextBlock FontSize="10" Margin="10,0,0,10" Text="{Binding Path=DenuncianteCi, StringFormat='Ci: {0}'}" VerticalAlignment="Bottom" Grid.Column="1" ToolTip="Ci denunciante" />
                </Grid>
            </Border>
        </DataTemplate>
        <DataTemplate x:Key="DenunciadoItemTemplate">
            <Border BorderThickness="0,0,0,0" BorderBrush="#6FBDE8">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="80" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <Image Source="Images/NoImage.jpg" Width="80" Height="80" Grid.Column="0" HorizontalAlignment="Center" />
                    <TextBlock Margin="10,0,0,0" Text="{Binding Denunciado}" VerticalAlignment="Center" Grid.Column="1" ToolTip="Nombre del denunciado" />
                    <TextBlock FontSize="10" Margin="10,0,0,10" Text="{Binding Path=DenunciadoCi, StringFormat='Ci: {0}'}" VerticalAlignment="Bottom" Grid.Column="1" ToolTip="Ci del denunciado" />
                </Grid>
            </Border>
        </DataTemplate>
        <DataTemplate x:Key="InstitucionItemTemplate">
            <Border BorderThickness="0,0,0,0" BorderBrush="#6FBDE8">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="80" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <Image Source="Images/NoImage.jpg" Width="80" Height="80" Grid.Column="0" HorizontalAlignment="Center" />
                    <TextBlock FontSize="10" Margin="10,0,0,0" Text="{Binding Institucion}" VerticalAlignment="Center" Grid.Column="1" ToolTip="Psicologo" />
                </Grid>
            </Border>
        </DataTemplate>
        <DataTemplate x:Key="DateItemTemplate">
            <Border BorderThickness="0,0,0,0" BorderBrush="#6FBDE8">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="80" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <Image Source="Images/NoImage.jpg" Width="80" Height="80" Grid.Column="0" HorizontalAlignment="Center" />
                    <TextBlock FontSize="10" Margin="10,0,0,0" Text="{Binding Date}" VerticalAlignment="Center" Grid.Column="1" ToolTip="Fecha" />
                </Grid>
            </Border>
        </DataTemplate>
        <ContextMenu x:Key="contextMenu">
            <MenuItem Header="Modificar" Foreground="White" Click="MenuItem_Click"></MenuItem>
            <MenuItem Header="Ver" Foreground="White" Click="MenuItem2_Click"></MenuItem>
        </ContextMenu>
    </UserControl.Resources>
    <Grid Name="Content">
        <Grid Height="36" Margin="11,11,56,0" Name="gridTitle"  VerticalAlignment="Top">
            <Border BorderBrush="#bababa" BorderThickness="0,0,0,1">
                <TextBlock FontSize="24" FontWeight="ExtraLight" Text="Ver Todas las Denuncias" Width="711" HorizontalAlignment="Left" ></TextBlock>
            </Border>
        </Grid>
        <Grid Margin="0,35,0,0">
            <ListView Width="830" Height="430" Name="listViewComplaints" ItemsSource="{Binding}" ItemContainerStyle="{DynamicResource ListViewItemContainerStyle}" Margin="25,40,0,0" VerticalAlignment="Top" HorizontalAlignment="Left">
                <ListView.View>
                    <GridView>
                        <GridViewColumn CellTemplate="{StaticResource DenuncianteItemTemplate}" Width="230" Header="Denunciante" />
                        <GridViewColumn CellTemplate="{StaticResource DenunciadoItemTemplate}" Width="230" Header="Denunciado" />
                        <GridViewColumn CellTemplate="{StaticResource InstitucionItemTemplate}" Width="230" Header="Institucion Derivada" />
                        <GridViewColumn CellTemplate="{StaticResource DateItemTemplate}" Width="140" Header="Fecha"/>
                    </GridView>
                </ListView.View>
                <ListView.ContextMenu>
                    <ContextMenu >
                        <MenuItem Header="Modificar" Foreground="White" Click="MenuItem_Click"></MenuItem>
                        <MenuItem Header="Ver" Foreground="White" Click="MenuItem2_Click"></MenuItem>
                    </ContextMenu>
                </ListView.ContextMenu>
            </ListView>
        </Grid>
    </Grid>
</UserControl>
